package com.lsu.app.bean;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;


import java.io.Serializable;



import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;

import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

/**
 * 
 * @Date 2023-10-16 19:31:52
 * @author hjj
 */
@Data
@TableName("user")
@ApiModel(value="User对象", description="")
public class User implements Serializable {

    @TableId(type = IdType.AUTO)
    @ApiModelProperty("#id")
    private Integer id;

    @JsonIgnore //数据库中不会输出该字段到json中
    @ApiModelProperty("#状态")
    private Integer state;

    @NotBlank(message="[]不能为空")
    @Size(max= 20,message="编码长度不能超过20")
    @ApiModelProperty("用户账号")
    private String username;

    @Size(max= 128,message="编码长度不能超过128")
    @JsonIgnore  //数据库中不会输出该字段到json中
    @ApiModelProperty("加密密码")
    private String password;

    @NotBlank(message="[]不能为空")
    @Size(max= 128,message="编码长度不能超过128")
    @ApiModelProperty("昵称")
    private String name;

    @NotBlank(message="[]不能为空")
    @ApiModelProperty("性别")
    private String sex;

    @ApiModelProperty("#创建时间")
    private String createTime;

    @ApiModelProperty("#更新时间")
    private String updateTime;

    @Size(max= 255,message="编码长度不能超过255")
    @ApiModelProperty("备注")
    private String remake;

    @TableField(exist = false) //该字段不存在于数据库中
    @Size(max= 64,message="编码长度不能超过64")
    @ApiModelProperty("#图片链接")
    private String imageUrl;

    @TableField(exist = false) //该字段不存在于数据库中
    @ApiModelProperty("#token校验")
    private String token;

    @TableField(exist = false) //该字段不存在于数据库中
    @ApiModelProperty("兴趣标签")
    private String[] taste;

    @TableField(exist = false) //该字段不存在于数据库中
    @ApiModelProperty("#教师是否已被关注（0未关注，1已关注）")
    private Integer selfLikeCollect;

    @TableField(exist = false) //该字段不存在于数据库中
    @ApiModelProperty("#关注量")
    private Integer fans;

    public User() {
    }

    public User(String username, String password, String name, String sex, String createTime, String updateTime, String remake) {
        this.username = username;
        this.password = password;
        this.name = name;
        this.sex = sex;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.remake = remake;
    }
}
